package com.zhentao.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zhentao.AdWithdrawal.domain.AdWithdrawal;
import com.zhentao.AdWithdrawal.dto.AdWithdrawalDto;
import com.zhentao.common.dtos.ResponseResult;
import com.zhentao.mapper.AdWithdrawalMapper;
import com.zhentao.service.AdWithdrawalService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 白耀东
 * @description 针对表【ad_withdrawal】的数据库操作Service实现
 * @createDate 2024-09-02 19:32:49
 */
@Service
public class AdWithdrawalServiceImpl extends ServiceImpl<AdWithdrawalMapper, AdWithdrawal>
        implements AdWithdrawalService {

    @Resource
    AdWithdrawalMapper adWithdrawalMapper;

    /**
     * 查询进行提现的用户请求
     *
     * @param dto
     * @return
     */
    @Override
    public ResponseResult moneyUserList(AdWithdrawalDto dto) {

        List<AdWithdrawal> adWithdrawalList = adWithdrawalMapper.selectMoneyUserList(dto.getStatus());
        PageHelper.startPage(dto.getOffset(), dto.getPagesize());
        PageInfo<AdWithdrawal> pageInfo = new PageInfo<>(adWithdrawalList);
        PageHelper.clearPage();
        return ResponseResult.okResult(pageInfo);
    }

    /**
     * 后台对提现的请求进行审核
     * 提现请求状态0待处理1已批准2已拒绝
     *
     * @param adWithdrawal
     * @return
     */
    @Override
    public ResponseResult upMoneyStatus(AdWithdrawal adWithdrawal) {

        return null;
    }
}




